package main

import (
	"fmt"
	"time"
)

func main21() {
	ch1 := make(chan string)
	ch2 := make(chan string)

	go func() {
		time.Sleep(time.Second)
		ch1 <- "message one"
	}()

	go func() {
		time.Sleep(2 * time.Second)
		ch2 <- "message two"
	}()

	for i := 0; i < 2; i++ {
		select {
		case s := <-ch1:
			{
				fmt.Println(s)
			}
		case s := <-ch2:
			{
				fmt.Println(s)
			}
		}
	}
}
